﻿@using 项目备忘录.Models;
@{
    Project project =(Project) ViewData["data"]; 

}
<div>
    编辑页面
    <form action="/edit/updateProject" method="post">
        <input name="id" type="hidden" value="@project.id" />
        <div id="country" style="display:none">@project.country</div>
        <div id="province" style="display:none">@project.province</div>
        <div id="status" style="display:none">@project.status</div>
        <table>
            <tr>
                <td>项目名称</td>
                <td><input name="projectName" placeholder="请输入项目名称" value="@project.projectName"/></td>
            </tr>

            <tr>
                <td>所在国家</td>
                <td>
                    <select name="country">
                        <option>中国</option>
                        <option>俄罗斯</option>
                        <option>乌克兰</option>
                        <option>漂亮国</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td>所在省市</td>
               <td>
                    <select name="province">
                        <option>北京</option>
                        <option>上海</option>
                        <option>成都</option>
                        <option>武汉</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td>项目简介</td>
                <td><textarea name="desc" placeholder="请输入项目简介"  value="@project.desc"></textarea></td>
            </tr>

            <tr>
                <td>项目业主</td>
                <td><input name="person" placeholder="请输入项目业主" value="@project.person"/></td>
            </tr>

            <tr>
                <td>市场开发经理</td>
                <td>
                    <button class="btn btn-primary">选择</button>
                </td>
            </tr>

            <tr>
                <td>所属部门</td>
                <td>
                    <input name="department"  value="@project.department" disabled />
                </td>
            </tr>

            <tr>
                <td>每天成本（元）</td>
                <td>
                    <input name='cost' type="number" value="@project.costs" />
                </td>
            </tr>

            <tr>
                <td>项目预期天数（天）</td>
                <td>
                    <input type="number" name='dayNum' value="@project.dayNum" />
                </td>
            </tr>

             <tr>
                <td>预计成本（元）</td>
                <td>
                    <input type="number" name="preCost" disabled />
                </td>
            </tr>
            <tr>
                <td>市场经理电话</td>
                <td>
                    <input name="managerTelNum"  value="@project.managerTelNum"/>
                </td>
            </tr>
            <tr>
                <td>初录日期</td>
                <td>
                    <input name="date" type="date"  value="@project.date"/>
                </td>
            </tr>
            <tr>

                <td>状态</td>
                <td>
                    <input name="status" type="radio" value="初录" />初录
                    <input name="status" type="radio" value="确认" />确认
                </td>
            </tr>
        </table>
        <input type="submit" value="提交" class="btn btn-primary" />
    </form>
</div>

<script>
    $(function(){
           var cost = 0
           var dayNum = 0
           var count = 0
             $('#cost').on('input', function(){
                 cost = parseInt($(this).val())
                  count =  cost*dayNum
                  $('#preCost').val(count)
            });

             $('#dayNum').on('input', function(){
                 dayNum = parseInt($(this).val())
                  console.log(dayNum)
                   count =  cost*dayNum
                    $('#preCost').val(count) 
            
            });



            
          
            

    })

</script>